<?php
namespace app\common\model;
use think\Model;
use think\Session;
/**
 * 手机验证码校验
 */
class Areas extends Model
{
	protected $table = 'area';
    /**
     * [country description]
     * @param  string $value [description]
     * @return [type]        [description]
     */
    public function country()
    {
    	//select area_code,parent_code,area_name,type from sys_area where type=0
    	$country = $this->where('type',0)->field(['area_code','parent_code','area_name','type'])->select();
    	return $country;
    }
    /**
     * [province description]
     * @param  string $value [description]
     * @return [type]        [description]
     */
    public function province()
    {
    	//select area_code,parent_code,area_name,type from sys_area where type=1
    	$province = $this->where('type',1)->field(['area_code','parent_code','area_name','type'])->select();
    	return $province;
    }
    /**
     * [city description]
     * @param  string $value [description]
     * @return [type]        [description]
     */
    public function city()
    {
    	$city = $this->where('type',2)->field(['area_code','parent_code','area_name','type'])->select();
    	return $city;
    }
}
